package tech.aistar.day05.onetoone.demo01;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/12 3:16 下午
 */
public class Husband {
    private int id;

    private String name;

    //一个丈夫拥有一个妻子
    //行话 - 丈夫实体类中应该要维护一个妻子对象
    private Wife wife;

    public Husband() {
    }

    public Husband(int id, String name, Wife wife) {
        this.id = id;
        this.name = name;
        this.wife = wife;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Wife getWife() {
        return wife;
    }

    public void setWife(Wife wife) {
        this.wife = wife;
    }

    //toString

    @Override
    public String toString() {
        return "Husband{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
